<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>轮播图效果</title>
</head>
<body>
    <img id="banner" src="image/banner_1.jpg" alt="#">
    <h6 id="title">你好 , 你是外星人吗</h6>
<script>
    var num = 1;
    function roll() {
        num = num + 1;
        if (num > 3) {
            num = 1;
        }
        var img = document.getElementById("banner");
        src = "image/banner_"+num+".jpg";
        img.src = src ; 
    }

    function fun() {
        var title = document.getElementById("title");
        title.innerHTML = "对不起 ,我不是"
    }
    setInterval(fun , 1000);
    // setInterval(roll , 2000);
</script>
</body>
</html>